package de.fhd.pms.dto;

import java.util.Date;
import de.fhd.pms.model.Auto;
import de.fhd.pms.model.Fahrt;
import de.fhd.pms.model.Kunde;

/**
 * Data transfer object used to represent a special version of {@link Fahrt}
 * containing {@link Auto} and {@link Kunde}.
 * 
 * @author Josef Fischer
 * @author Alexander Neetzel
 * @author Philipp Six
 */
public class FahrtDTO implements Comparable<FahrtDTO> {

	private Date abfahrt;
	private int id;
	private String autoMarke;
	private String autoModell;
	private String kundeVorname;
	private String kundeNachname;
	private float km;
	private Date abfahrtDate;
	private Date ankunftDate;
	private long dauer;
	private float kosten;
	private int autoId;
	private int kundeId;

	public FahrtDTO(int fahrtId, String autoMarke, String autoModell,
			String kundeVorname, String kundeNachname, float km,
			Date abfahrtDate, Date ankunftDate, long dauer, float kosten,
			int autoId, int kundeId) {
		this.id = fahrtId;
		this.autoMarke = autoMarke;
		this.autoModell = autoModell;
		this.kundeVorname = kundeVorname;
		this.kundeNachname = kundeNachname;
		this.km = km;
		this.abfahrtDate = abfahrtDate;
		this.ankunftDate = ankunftDate;
		this.dauer = dauer;
		this.kosten = kosten;
		this.autoId = autoId;
		this.kundeId = kundeId;

	}

	public int getId() {
		return id;
	}

	public String getAutoMarke() {
		return autoMarke;
	}

	public String getAutoModell() {
		return autoModell;
	}

	public String getKundeNachname() {
		return kundeNachname;
	}

	public String getKundeVorname() {
		return kundeVorname;
	}

	public float getKm() {
		return km;
	}

	public Date getAbfahrtDate() {
		return abfahrtDate;
	}

	public Date getAnkunftDate() {
		return ankunftDate;
	}

	@Override
	public int compareTo(FahrtDTO o) {
		if (this.abfahrt == null && o.abfahrt == null) {
			return this.id - o.id;
		} else if (this.abfahrt == null) {
			return -1;
		} else if (o.abfahrt == null) {
			return 1;
		} else {
			return this.abfahrt.compareTo(o.abfahrt);
		}
	}

	public long getDauer() {
		return dauer;
	}

	public float getKosten() {
		return kosten;
	}

	public int getAutoId() {
		return autoId;
	}

	public int getKundeId() {
		return kundeId;
	}

}
